#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <stdio.h>
#include <unistd.h> /* close */
#include <pthread.h>
#include <termios.h>
#include <fcntl.h>
#include <stdlib.h>
#include <errno.h>

int main(void)
{
    int fd_in;
    int fd_out;
    int data_size = 1;
    char buff[100];
    fd_out = open("./dump_bp", O_RDWR | O_APPEND | O_CREAT);
    fd_in  = open("./fork.c", O_RDWR | O_APPEND );
    while(data_size != 0){
        data_size = read(fd_in, buff, sizeof(buff));
        write(fd_out, buff, data_size);
    }
    close(fd_in);
    close(fd_out);

    return 0;
}
